/*
 * @Description:ajax代理
 * @Version: P0600_V1.1
 * @Author: chenm
 * @Date: 2020-09-12 23:57:25
 */
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
  app.use(
    "/rate",
    createProxyMiddleware({
      target: "http://op.juhe.cn/onebox/exchange",
      changeOrigin: true,
      pathRewrite: { "^/rate": "" },
    })
  );
  app.use(
    "/gold",
    createProxyMiddleware({
      target: "http://web.juhe.cn:8080/finance/gold",
      changeOrigin: true,
      pathRewrite: { "^/gold": "" },
    })
  );
};
